﻿using UnityEngine;
using System.Collections;

public class ResultScreen : Actors
{
	public float m_ButtonPositionX = 0.5f;
	public float m_ButtonPositionY = 0.5f;

	public float m_ButtonWidth = 0.15f;
	public float m_ButtonHeight = 0.1f;

	public GamesManager.m_ScenesID m_SceneToLoad;

	private Rect m_ButtonRect = new Rect();
	private Vector2 m_RectPosition = new Vector2();
	private bool m_CanShowButton;

	public void OnAnimationINComplete()
	{
		m_CanShowButton = true;
	}

	private void OnGUI()
	{
		if(m_CanShowButton)
		{
			m_RectPosition.x = Screen.width * (m_ButtonPositionX - m_ButtonWidth/2f);
			m_RectPosition.y = Screen.height * (m_ButtonPositionY - m_ButtonHeight/2f);
			m_ButtonRect.position = m_RectPosition;
			m_ButtonRect.width = Screen.width * m_ButtonWidth;
			m_ButtonRect.height = Screen.height * m_ButtonHeight;
			if (GUI.Button(m_ButtonRect, "REPLAY"))
			{
				//Application.LoadLevel((int)GamesManager.m_ScenesID.TroubleGame);
				Application.LoadLevel((int)m_SceneToLoad);
			}
		}
	}
}
